<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('已派工单来电')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            流水号：<input type="text" name="wsCode"/>
                        </li>
                        <li>
                            来电号码：<input type="text" name="fromTelA"/>
                        </li>
                        <li>
                            来电人：<input type="text" name="fromName"/>
                        </li>
                        <li>
                            地区名称：<input type="text" name="fmAreaName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-primary single disabled" onclick="$.operate.editTab()"
               shiro:hasPermission="mTelRcd:processEdit:view">
                <i class="fa fa-edit"></i> 修改
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/mTelRcd";
    $(function () {
        var options = {
            url: prefix + "/listWork",
            updateUrl: prefix + "/processEdit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            sortName: "pkid",
            sortOrder: "desc",
            uniqueId: "pkId",
            modalName: "已派工单来电",
            columns: [{
                checkbox: true
            },
                {field:'wsCode',title:'流水号',align:'left',halign:'center',sortable:true/*,formatter:function(value,row,index){return fmtScanByNO(value,row,index);}*/},
                {field:'liftTelNo',title:'接听分机',align:'center'},
                {field:'liftWorker',title:'接听人',align:'center'},
                {field:'fmAreaName',title:'地区',align:'center',sortable:true},
                {field:'fromTelA',title:'来电号码',align:'left',halign:'center',sortable:true},
                {field:'fromName',title:'来话人',align:'center',sortable:true},
                {field:'fromTime',title:'接听时间',align:'center',sortable:true},
                {field:'opDate',title:'创建日期',align:'center',formatter:function (value) {
                        return resultFormatter(value);
                    }},
                {field:'wkFmNo',title:'工单号',align:'center',sortable:true},
                {field:'myDesc',title:'备注',align:'left',halign:'center'}]
        };
        $.table.init(options);
    });
    function resultFormatter(cellval) {
        if (cellval) {
            var date = new Date(cellval);
            var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
            var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
            return date.getFullYear() + "-" + month + "-" + currentDate;
        }
        return "";
    }
</script>
</body>
</html>